<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>人员添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
  <style>
    .full-width-container {
      width: 100vw;
      margin-left: -20px;
      padding: 20px;
      box-sizing: border-box;
    }

    /* 容器基础样式 */
    .dia_y {
      width: 50%;
      margin: 1%;
      height: 400px;
      overflow-y: auto;
      overflow-x: hidden;
      position: relative;
      /* border: 1px solid #ccc; /* 加上边框更贴近示例 */
      border-radius: 4px;
    }

    .dia_z {
      /* border: 2px solid #ccc; */
      width: 50%;
      margin: 1%;
      height: 400px;
      overflow-y: auto;
      overflow-x: hidden;
      position: relative;
      /* 为子元素固定定位提供参考 */
    }

    .sticky-input {
      position: sticky;
      top: 0;
      /* 固定在容器顶部 */
      background: #fff;
      /* 背景色与容器一致 */
      z-index: 10;
      /* 确保输入框在树组件上方 */
      padding: 10px 0;
      /* 保持与原布局一致的间距 */
      border-bottom: 1px solid #eee;
      /* 可选：添加分隔线 */
    }

    .scroll-content {
      padding-top: 10px;
      /* 为固定输入框留出空间 */
      height: calc(100% - 50px);
      /* 滚动内容区域高度 */
    }

    /* 顶部统计栏 */
    .xuche {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 15px;
      background-color: #f5f7fa;
      border-bottom: 1px solid #e4e7ed;
    }

    /* 多选框列表区域 */
    .checkbox-grid {
      padding: 10px 15px;
    }

    /* 调整多选框样式，让每个选项垂直分布更合理 */
    .el-checkbox {
      display: block;
      margin-bottom: 8px;
    }

    /* 滚动条样式（可选，让滚动条更美观） */
    .dia_y::-webkit-scrollbar {
      width: 6px;
    }

    .dia_y::-webkit-scrollbar-thumb {
      background-color: #c0c4cc;
      border-radius: 3px;
    }

    .dia_y::-webkit-scrollbar-track {
      background-color: #f5f7fa;
    }
  </style>
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>

    </header>

    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'work_teams', 'form': 'dataForm','primary_key':'Work_Team_SerialNumber' })">

      <div class="yl-main">

        <el-dialog v-model="dialogFormVisible" title="工作队员" width="800">
          <div style="display: flex;justify-content: center;">
            <div class="dia_z">
              <!-- 固定的输入框 -->
              <div class="sticky-input">
                <el-input style="width: 95%;" placeholder="输入关键字进行过滤" v-model="filterText">
                </el-input>
              </div>

              <!-- 滚动内容区域 -->
              <div class="scroll-content">
                <el-tree class="filter-tree" :data="treeData" :props="{ children: 'children',label:'Party_Organization_Name'}"
                  default-expand-all :filter-node-method="filterNode" @node-click="handleNodeClick" ref="tree">
                </el-tree>

              </div>


            

            </div>
            <div class="dia_y">
              <div class="checkbox-container">
                <!-- 顶部已选统计和清空按钮 -->
                <div class="xuche">
                  <div>已选中&nbsp;{{ selectedCount }}&nbsp;个</div>
                  <div><el-button type="primary" icon="close" @click="clearAll">清空</el-button></div>
                </div>
                <!-- 多选框列表 -->
                <div class="checkbox-grid">
                  <el-checkbox v-for="(option, index) in checkboxOptions" :key="index" v-model="option.checked"
                    :label="option.Personal_Name" :size="option.size" @change="handleCheckboxChange(option)">
                    {{ option.Personal_Name }}
                  </el-checkbox>
                </div>
              </div>
            </div>
          </div>
          <template #footer>
            <div class="dialog-footer">
             
              <el-button type="primary" @click="dialogFormVisible = false">
                确认
              </el-button>
            </div>
          </template>
        </el-dialog>
        <!-- <span style="font-size: 26p;font-weight: 800; display: inline-block;margin: 10px;">选择工作队负责人</span> -->


        <header>
          <div class="m-toolbar panel-header panel-header-noborder " style="margin-top: 30px;">
            <div class="m-title">工作队成员信息</div>
          </div>
        </header>
        <div id="ChildTable">
          <!-- <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'work_teams_members', 'form': 'tableData', 'ParentTableName': 'work_teams'})"
            :column="2" size="large" border v-for="(item,index) in tableData.filter(item => item.Row_Status != '1')"
            :key="index">

          </el-descriptions> -->


          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'work_teams_members', 'form': 'tableData', 'ParentTableName': 'work_teams'})">

          </el-descriptions>


          <el-button type="primary" style="margin-top: 20px; width: 120px;" @click="xin()">新增工作队成员</el-button>


          
          <el-table :data="tableData.filter(item => item.Row_Status != '1')" border style="width: 100%;margin-top: 20px;">
            <el-table-column prop="ID_Card_Number" label="身份证编号" align="center">
            </el-table-column>
            <el-table-column prop="Personal_Name" label="队员姓名" align="center">
              <template #default="{ row }">
                <span style="color: #409EFF; cursor: pointer; text-decoration: underline;"
                  @click="handleNameClick(row)">
                  {{ row.Personal_Name }}
                </span>
              </template>
            </el-table-column>
            <el-table-column prop="Contact_Phone" label="联系电话" align="center">
            </el-table-column>

            <el-table-column prop="Position" label="职务" align="center" header-align="center">
            <template #default="scope">
               <!-- {{ scope.row.Position}} @change="handlePositionChange(scope.row, $event)" -->
              <el-select v-model="scope.row.Position" placeholder="请选择">
                <el-option v-for="item in positions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
<!-- @change="handleDateChange(scope.row, 'Start_Date', $event)" -->
            <el-table-column prop="Start_Date" label="驻村开始时间" align="center" header-align="center">
            <template #default="scope">
              <el-date-picker v-model="scope.row.Start_Date" type="date" placeholder="选择日期" :allow-empty="true"
                style="width: 100%" format="YYYY-MM-DD" value-format="YYYY-MM-DD">
              </el-date-picker>
            </template>
          </el-table-column>
            <!-- 单选列 -->
            <el-table-column prop="Is_Captain" width="100" label="是否负责人">
              <template #default="{ row }">
                <el-radio v-model="row.Is_Captain" label="1" @change="handleSelect(row)">负责人</el-radio>
              </template>
            </el-table-column>

          </el-table>
        </div>
      </div>
    </div>
    <el-dialog title="人员详细信息" v-model="dialogVisible" width="50%" :before-close="handleClose">
      <div class="member-card">


        <el-divider></el-divider>

        <div class="member-details">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="detail-item">
                <span class="detail-label">姓名:</span>
                <span class="detail-value">{{ currentMember.Personal_Name || '未填写' }}</span>
              </div>
              <div class="detail-item">
                <span class="detail-label">性别:</span>
                <span class="detail-value">{{ currentMember.Gender || '未填写' }}</span>
              </div>
              <div class="detail-item">
                <span class="detail-label">出生日期:</span>
                <span class="detail-value">{{ currentMember.Birthday || '未填写' }}</span>
              </div>

              <div class="detail-item">
                <span class="detail-label">户籍地:</span>
                <span class="detail-value">{{ currentMember.Registered_Residence || '未填写' }}</span>
              </div>

              <div class="detail-item">
                <span class="detail-label">联系电话:</span>
                <span class="detail-value">{{ currentMember.Contact_Phone || '未填写' }}</span>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="detail-item">
                <span class="detail-label">民族:</span>
                <span class="detail-value">{{ currentMember.Nation || '未填写' }}</span>
              </div>
              <div class="detail-item">
                <span class="detail-label">政治面貌:</span>
                <span class="detail-value">{{ currentMember.Political_Affiliation || '未填写' }}</span>
              </div>
              <div class="detail-item">
                <span class="detail-label">家庭住址:</span>
                <span class="detail-value">{{ currentMember.Home_Address || '未填写' }}</span>
              </div>
            </el-col>
          </el-row>
        </div>

        <el-divider></el-divider>


      </div>


    </el-dialog>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit2" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>

<script src="../../../utils/utils.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../utils/ID_Validity.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/memberAddNew.js"></script>

</html>